package work.mediway.mdm.core.enums;

import java.util.HashMap;
import java.util.Map;

import lombok.Getter;
import lombok.Setter;

/**
 * 状态
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2020/12/29
 */
public enum PermEnum {

    /**
     * 查看
     */
    VIEW("VIEW", "查看"),

    /**
     * 编辑
     */
    EDIT("EDIT", "编辑"),

    /**
     * 删除
     */
    DELETE("DELETE", "删除"),

    /**
     * 新增
     */
    ADD("ADD", "新增"),

    /**
     * 新增
     */
    REQUIRE("REQUIRE", "必需")

    // ======================================================================= //
    ;

    public static Map<String, String> map = new HashMap<>();

    static {
        PermEnum[] values = PermEnum.values();
        if (values.length > 0) {
            for (PermEnum categoryEnum : values) {
                map.put(categoryEnum.getPerm(), categoryEnum.getDesc());
            }
        }
    }

    PermEnum(String perm, String desc) {
        this.perm = perm;
        this.desc = desc;
    }

    /**
     * Code
     */
    @Setter
    @Getter
    private String perm;

    /**
     * Desc
     */
    @Setter
    @Getter
    private String desc;

}
